Data and code for "Spatial and temporal expansion of global wildland fire activity in response to climate change" by Martin Senande-Rivera, Damian Insua-Costa and Gonzalo Miguez-Macho

Data formats: netcdf and csv
Codes: Python v3.8

############
### DATA ###
############

Inside DATA folder there are the following datasets:
	GFED4 folder: 
		DATA folder: where GFED4 monthly burned area data must be located (see DATA/GFED4/README.txt)
		GFED4_BA_a_mean.nc: Mean annual burned area data
		GFED4_BA_m_mean.nc: Mean monthly burned area data
		GFED4_BA_years.nc: Annual burned area data
		GFED4_BA_months.nc: Montly burned area data
	WFED5 folder: 
		DATA folder: where WFED5 monthly meteorological variables (near-surface air temperature, rainfall flux and snowfall flux) must be located (see DATA/WFED5/README.txt)
		wfde5_t2m_a_mean.nc: Mean annual temperature
		wfde5_t2m_m_mean.nc: Mean monthly temperature
		wfde5_t2m_months.nc: Monthly temperature
		wfde5_tp_a_mean.nc: Mean annual rainfall
		wfde5_tp_m_mean.nc: Mean monthly rainfall
		wfde5_tp_months.nc: Monthly rainfall
		wfde5_sn_a_mean.nc: Mean annual snowfall
		wfde5_sn_m_mean.nc: Mean monthly snowfall
		wfde5_sn_months.nc: Monthly snowfall
		wfde5_t2m_a_mean_interp025.nc: Mean annual temperature interpolated to 0.25 grid
		wfde5_t2m_m_mean_interp025.nc: Mean monthly temperature interpolated to 0.25 grid
		wfde5_t2m_months_interp025.nc: Monthly temperature interpolated to 0.25 grid
		wfde5_tp_a_mean_interp025.nc: Mean annual precipitation interpolated to 0.25 grid
		wfde5_tp_m_mean_interp025.nc: Mean monthly precipitation interpolated to 0.25 grid
		wfde5_tp_months_interp025.nc: Monthly precipitation interpolated to 0.25 grid

Inside Classification folder there are the following datasets:
	1-Threshold_selection folder:
		BA_max.nc: 1996-2016 maximum annual burned area (BAmax) array. Shape: lat-720,lon-1440
		FS_array.nc: Binary array over 12 months with 1 in fire season months and 0 in non fire season months. Shape: time-12,lat-720,lon-1440
		FS_fullarray.nc: Binary array over 12 months with 1 in fire season months and 0 in non fire season months copied for all years. Shape: time-252,lat-720,lon-1440
		KG_class.nc: Array with the Koppen-Geiger classification for each spatial point. 1-A (tropical), 2-B (arid), 3-C (temperate), 4-D (Cold) and 5-E (polar). Shape: lat-720,lon-1440
		P_perce.nc: Average monthly precipitation percentage from the annual total for the fire season (PPFS). Shape: lat-720,lon-1440
		T_anom.nc: Average monthly temperature anomaly from the annual mean for the fire season (TAFS). Shape: lat-720,lon-1440
		Thresholds.csv: Obtained thresholds for each variable.
		Thresholds_dx.csv: Obtained threshold uncertainties for each variable.
	2-Classification folder: 
		FC_array.nc: Array with 0 in non fire-prone months and climate numbers (1,2,3,4) in fire-prone months. Shape: time-252,lat-720,lon-1440
		FC.nc: Array with 0 in non fire-prone points and fire-classification codes in fire-prone points: 11=Tr-ds-r, 12=Tr-ds-o, 13=Tr-ds-i, 21=Ar-fl-r, 22=Ar-fl-o, 23=Ar-fl-i, 31=Te-dhs-r, 32=Te-dhs-o, 33=Te-dhs-i, 41=Bo-hs-r, 42=Bo-hs-o, 43=Bo-hs-i Shape: lat-720,lon-1440
		Years_FC.nc: Array with 0 in non fire-prone years and climate numbers (1,2,3,4) in fire-prone years. Shape: time-21,lat-720,lon-1440
		PFS.nc: Array with the mean Potential Fire Season Length in months. Shape: lat-720,lon-1440
	3-Validation folder:
		FC_val.nc: Array with classified BA>0ha points (1,2,3,4), unclassified BA=0ha points (0), classified 'BA=0ha points (5) and unclassified BA>0ha (6). Shape: lat-720,lon-1440
	4-Future_Classification folder:
		FC.nc: Array with 0 in non fire-prone points and fire-classification codes in fire-prone points for future climate: 11=Tr-ds-r, 12=Tr-ds-o, 13=Tr-ds-i, 21=Ar-fl-r, 22=Ar-fl-o, 23=Ar-fl-i, 31=Te-dhs-r, 32=Te-dhs-o, 33=Te-dhs-i, 41=Bo-hs-r, 42=Bo-hs-o, 43=Bo-hs-i Shape: lat-720,lon-1440
		Years_FC.nc: Array with 0 in non fire-prone years and climate numbers (1,2,3,4) in fire-prone years for future climate. Shape: time-21,lat-720,lon-1440
		PFS.nc: Array with the mean Potential Fire Season Length in months for future climate. Shape: lat-720,lon-1440
		FC_confidence.nc: Array with the confidence percentage of the future fire-climate classificaitons, estimates as the percentage of CMIP5 GCMs agreeing on the result.
		dYears.nc: Array with the difference between future and present fire-prone years.
		dPFS.nc: Array with the difference between future and present potential fire season length.


############
### CODE ###
############

Inside DATA folder there are the following files:
	GFED4_means.py: It calculates monthly values, annual values, annual averages and monthly averages of GFED4 data
	WFDE5_means.py: It calculates monthly values, annual averages and monthly averages of WFDE5 data
	WFDE5_interpolate.py: It interpolates monthly values, annual averages and monthly averages of WFDE5 data to 0.25 grid

Inside Classification folder there are the following items:
	1-Threshold_selection folder:
		1-FSL_obs.py: It calculates the fire season for each spatial point from GFED4 burned area data.
		2-KG_classification.py: It classifies global points according to Koppen-Geiger general climate classes from WFDE5 data.
		3-Distributions.py: Code for obtaining the statistical density functions for each variable and the corresponding thresholds.
		4-FS_vars.py: Code for obtaining the maximum annual burned area (BAmax), the average monthly precipitation percentage from the annual total for the fire season (PPFS) and the average monthly temperature anomaly from the annual mean for the fire season (TAFS).
	2-Classification folder: 
		1-Classification.py: It classifies global points according to fire-climate classifications.
	3-Validation folder:
		1-Validation.py: It compares fire-climate classification to burned area data.
	4-Future_Classification folder:
		1-Classification.py: It classifies global points according to future fire-climate classifications.
		2-Comparison.py: It ccompares the present against future fire-climate classifications.

Inside PLOTS folder there are the following files:
	Plot_Figure1.py: Code for plotting Figure 1.
	Plot_Figure2.py: Code for plotting Figure 2.
	Plot_Figure3.py: Code for plotting Figure 3.
	Plot_Figure4.py: Code for plotting Figure 4.
